3.216 \(\int \frac {\cot ^5(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=115 \[ \frac {b^3 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 f (a-b)}+\frac {(a+b) \cot ^2(e+f x)}{2 a^2 f}+\frac {\left (a^2+a b+b^2\right ) \log (\tan (e+f x))}{a^3 f}+\frac {\log (\cos (e+f x))}{f (a-b)}-\frac {\cot ^4(e+f x)}{4 a f} \]

[Out]

1/2*(a+b)*cot(f*x+e)^2/a^2/f-1/4*cot(f*x+e)^4/a/f+ln(cos(f*x+e))/(a-b)/f+(a^2+a*b+b^2)*ln(tan(f*x+e))/a^3/f+1/
2*b^3*ln(a+b*tan(f*x+e)^2)/a^3/(a-b)/f

________________________________________________________________________________________

Rubi [A]  time = 0.14, antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3670, 446, 72} \[ \frac {b^3 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 f (a-b)}+\frac {\left (a^2+a b+b^2\right ) \log (\tan (e+f x))}{a^3 f}+\frac {(a+b) \cot ^2(e+f x)}{2 a^2 f}+\frac {\log (\cos (e+f x))}{f (a-b)}-\frac {\cot ^4(e+f x)}{4 a f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^5/(a + b*Tan[e + f*x]^2),x]

[Out]

((a + b)*Cot[e + f*x]^2)/(2*a^2*f) - Cot[e + f*x]^4/(4*a*f) + Log[Cos[e + f*x]]/((a - b)*f) + ((a^2 + a*b + b^
2)*Log[Tan[e + f*x]])/(a^3*f) + (b^3*Log[a + b*Tan[e + f*x]^2])/(2*a^3*(a - b)*f)

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\cot ^5(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {1}{x^5 \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {1}{x^3 (1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {1}{a x^3}+\frac {-a-b}{a^2 x^2}+\frac {a^2+a b+b^2}{a^3 x}-\frac {1}{(a-b) (1+x)}+\frac {b^4}{a^3 (a-b) (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {(a+b) \cot ^2(e+f x)}{2 a^2 f}-\frac {\cot ^4(e+f x)}{4 a f}+\frac {\log (\cos (e+f x))}{(a-b) f}+\frac {\left (a^2+a b+b^2\right ) \log (\tan (e+f x))}{a^3 f}+\frac {b^3 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 (a-b) f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.37, size = 83, normalized size = 0.72 \[ -\frac {-\frac {b^3 \log \left (a \cot ^2(e+f x)+b\right )}{a^3 (a-b)}-\frac {(a+b) \cot ^2(e+f x)}{a^2}-\frac {2 \log (\sin (e+f x))}{a-b}+\frac {\cot ^4(e+f x)}{2 a}}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^5/(a + b*Tan[e + f*x]^2),x]

[Out]

-1/2*(-(((a + b)*Cot[e + f*x]^2)/a^2) + Cot[e + f*x]^4/(2*a) - (b^3*Log[b + a*Cot[e + f*x]^2])/(a^3*(a - b)) -
 (2*Log[Sin[e + f*x]])/(a - b))/f

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 163, normalized size = 1.42 \[ \frac {2 \, b^{3} \log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{4} + 2 \, {\left (a^{3} - b^{3}\right )} \log \left (\frac {\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{4} + {\left (3 \, a^{3} - a^{2} b - 2 \, a b^{2}\right )} \tan \left (f x + e\right )^{4} - a^{3} + a^{2} b + 2 \, {\left (a^{3} - a b^{2}\right )} \tan \left (f x + e\right )^{2}}{4 \, {\left (a^{4} - a^{3} b\right )} f \tan \left (f x + e\right )^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/4*(2*b^3*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1))*tan(f*x + e)^4 + 2*(a^3 - b^3)*log(tan(f*x + e)^2/
(tan(f*x + e)^2 + 1))*tan(f*x + e)^4 + (3*a^3 - a^2*b - 2*a*b^2)*tan(f*x + e)^4 - a^3 + a^2*b + 2*(a^3 - a*b^2
)*tan(f*x + e)^2)/((a^4 - a^3*b)*f*tan(f*x + e)^4)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*((-32*((1-cos(
f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a+384*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+256*(1-cos(f*x+exp(1)))/(1
+cos(f*x+exp(1)))*b)*1/4096/a^2+(-48*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a^2-48*((1-cos(f*x+exp(1)))/(
1+cos(f*x+exp(1))))^2*a*b-48*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*b^2+12*(1-cos(f*x+exp(1)))/(1+cos(f*x
+exp(1)))*a^2+8*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a*b-a^2)*1/128/a^3/((1-cos(f*x+exp(1)))/(1+cos(f*x+exp
(1))))^2-1/(2*a-2*b)*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1))+b^3/(4*a^4-4*a^3*b)*ln(((1-cos(f*x+exp
(1)))/(1+cos(f*x+exp(1))))^2*a-2*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+4*(1-cos(f*x+exp(1)))/(1+cos(f*x+ex
p(1)))*b+a)+(a^2+a*b+b^2)*1/4/a^3*ln(abs(1-cos(f*x+exp(1)))/abs(1+cos(f*x+exp(1)))))

________________________________________________________________________________________

maple [B]  time = 0.92, size = 264, normalized size = 2.30 \[ \frac {b^{3} \ln \left (a \left (\cos ^{2}\left (f x +e \right )\right )-\left (\cos ^{2}\left (f x +e \right )\right ) b +b \right )}{2 f \,a^{3} \left (a -b \right )}-\frac {1}{16 f a \left (-1+\cos \left (f x +e \right )\right )^{2}}-\frac {7}{16 f a \left (-1+\cos \left (f x +e \right )\right )}-\frac {b}{4 f \,a^{2} \left (-1+\cos \left (f x +e \right )\right )}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 f a}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right ) b}{2 f \,a^{2}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right ) b^{2}}{2 f \,a^{3}}-\frac {1}{16 f a \left (1+\cos \left (f x +e \right )\right )^{2}}+\frac {7}{16 f a \left (1+\cos \left (f x +e \right )\right )}+\frac {b}{4 f \,a^{2} \left (1+\cos \left (f x +e \right )\right )}+\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 f a}+\frac {\ln \left (1+\cos \left (f x +e \right )\right ) b}{2 f \,a^{2}}+\frac {\ln \left (1+\cos \left (f x +e \right )\right ) b^{2}}{2 f \,a^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^5/(a+b*tan(f*x+e)^2),x)

[Out]

1/2/f*b^3/a^3/(a-b)*ln(a*cos(f*x+e)^2-cos(f*x+e)^2*b+b)-1/16/f/a/(-1+cos(f*x+e))^2-7/16/f/a/(-1+cos(f*x+e))-1/
4/f/a^2/(-1+cos(f*x+e))*b+1/2/f/a*ln(-1+cos(f*x+e))+1/2/f/a^2*ln(-1+cos(f*x+e))*b+1/2/f/a^3*ln(-1+cos(f*x+e))*
b^2-1/16/f/a/(1+cos(f*x+e))^2+7/16/f/a/(1+cos(f*x+e))+1/4/f/a^2/(1+cos(f*x+e))*b+1/2/f/a*ln(1+cos(f*x+e))+1/2/
f/a^2*ln(1+cos(f*x+e))*b+1/2/f/a^3*ln(1+cos(f*x+e))*b^2

________________________________________________________________________________________

maxima [A]  time = 0.46, size = 96, normalized size = 0.83 \[ \frac {\frac {2 \, b^{3} \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{4} - a^{3} b} + \frac {2 \, {\left (a^{2} + a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2}\right )}{a^{3}} + \frac {2 \, {\left (2 \, a + b\right )} \sin \left (f x + e\right )^{2} - a}{a^{2} \sin \left (f x + e\right )^{4}}}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/4*(2*b^3*log(-(a - b)*sin(f*x + e)^2 + a)/(a^4 - a^3*b) + 2*(a^2 + a*b + b^2)*log(sin(f*x + e)^2)/a^3 + (2*(
2*a + b)*sin(f*x + e)^2 - a)/(a^2*sin(f*x + e)^4))/f

________________________________________________________________________________________

mupad [B]  time = 11.78, size = 118, normalized size = 1.03 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a^2+a\,b+b^2\right )}{a^3\,f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,f\,\left (a-b\right )}-\frac {b^3\,\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )}{f\,\left (2\,a^3\,b-2\,a^4\right )}-\frac {{\mathrm {cot}\left (e+f\,x\right )}^4\,\left (\frac {1}{4\,a}-\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (a+b\right )}{2\,a^2}\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)^5/(a + b*tan(e + f*x)^2),x)

[Out]

(log(tan(e + f*x))*(a*b + a^2 + b^2))/(a^3*f) - log(tan(e + f*x)^2 + 1)/(2*f*(a - b)) - (b^3*log(a + b*tan(e +
 f*x)^2))/(f*(2*a^3*b - 2*a^4)) - (cot(e + f*x)^4*(1/(4*a) - (tan(e + f*x)^2*(a + b))/(2*a^2)))/f

________________________________________________________________________________________

sympy [A]  time = 94.47, size = 908, normalized size = 7.90 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**5/(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0) & Eq(e, 0) & Eq(f, 0)), ((log(tan(e + f*x)**2 + 1)/(2*f) - log(tan(e + f
*x))/f - 1/(2*f*tan(e + f*x)**2) + 1/(4*f*tan(e + f*x)**4) - 1/(6*f*tan(e + f*x)**6))/b, Eq(a, 0)), (-6*log(ta
n(e + f*x)**2 + 1)*tan(e + f*x)**6/(4*a*f*tan(e + f*x)**6 + 4*a*f*tan(e + f*x)**4) - 6*log(tan(e + f*x)**2 + 1
)*tan(e + f*x)**4/(4*a*f*tan(e + f*x)**6 + 4*a*f*tan(e + f*x)**4) + 12*log(tan(e + f*x))*tan(e + f*x)**6/(4*a*
f*tan(e + f*x)**6 + 4*a*f*tan(e + f*x)**4) + 12*log(tan(e + f*x))*tan(e + f*x)**4/(4*a*f*tan(e + f*x)**6 + 4*a
*f*tan(e + f*x)**4) + 6*tan(e + f*x)**4/(4*a*f*tan(e + f*x)**6 + 4*a*f*tan(e + f*x)**4) + 3*tan(e + f*x)**2/(4
*a*f*tan(e + f*x)**6 + 4*a*f*tan(e + f*x)**4) - 1/(4*a*f*tan(e + f*x)**6 + 4*a*f*tan(e + f*x)**4), Eq(a, b)),
(zoo*x/a, Eq(e, -f*x)), (x*cot(e)**5/(a + b*tan(e)**2), Eq(f, 0)), ((-log(tan(e + f*x)**2 + 1)/(2*f) + log(tan
(e + f*x))/f + 1/(2*f*tan(e + f*x)**2) - 1/(4*f*tan(e + f*x)**4))/a, Eq(b, 0)), (-2*a**3*log(tan(e + f*x)**2 +
 1)*tan(e + f*x)**4/(4*a**4*f*tan(e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) + 4*a**3*log(tan(e + f*x))*tan(e +
 f*x)**4/(4*a**4*f*tan(e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) + 2*a**3*tan(e + f*x)**2/(4*a**4*f*tan(e + f*
x)**4 - 4*a**3*b*f*tan(e + f*x)**4) - a**3/(4*a**4*f*tan(e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) + a**2*b/(4
*a**4*f*tan(e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) - 2*a*b**2*tan(e + f*x)**2/(4*a**4*f*tan(e + f*x)**4 - 4
*a**3*b*f*tan(e + f*x)**4) + 2*b**3*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))*tan(e + f*x)**4/(4*a**4*f*tan(e +
 f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) + 2*b**3*log(I*sqrt(a)*sqrt(1/b) + tan(e + f*x))*tan(e + f*x)**4/(4*a**
4*f*tan(e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) - 4*b**3*log(tan(e + f*x))*tan(e + f*x)**4/(4*a**4*f*tan(e +
 f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4), True))

________________________________________________________________________________________